package com.sinochem.yunlian.ship.base.biz;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.sinochem.yunlian.ship.base.entity.BsCategory;
import com.sinochem.yunlian.ship.base.entity.BsMaterialCategory;
import com.sinochem.yunlian.ship.base.mapper.BsCategoryMapper;
import com.sinochem.yunlian.ship.base.mapper.BsMaterialCategoryMapper;
import com.sinochem.yunlian.ship.common.biz.BaseBiz;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 类别基础信息表
 *
 * @author cyp
 * @email ${email}
 * @date 2017-11-21 19:06:25
 */
@Service
public class BsCategoryBiz extends BaseBiz<BsCategoryMapper,BsCategory> {

    public List<BsCategory> findAllCategory(String categoryType) {
        return mapper.findAllCategory(categoryType);
    }

	public String getBsCategoryName(Long id) {
		return mapper.getBsCategoryList(id);
	}

	public Page<BsCategory> findCategoryByCondition(Map params){
        Page<BsCategory> result = PageHelper.startPage(Integer.parseInt(params.get("pageNum")+""),Integer.parseInt(params.get("pageSize")+""));
        mapper.findCategoryByCondition(params);
        return result;
    }

    public List<BsCategory> findByLevel() {
        return mapper.findByLevel();
    }

}